<?php

$oReq = &App::getRequest();

if ( $oReq->get('id') )
{
	$aAjaxFunctions = array
	(
		'newComment',
		'listComments',
		'setStars',
		'videoReport',
		'videoSaveFavorite',
		'getFriendsList',
		'videoInviteUser',
		'videoAddFeature',
		'videoRemoveFeature',
		'loadEmoticons',
		'loginBox'
	);

	App::loadAjax(array('Video', 'Smiles'), $aAjaxFunctions);

    $oTpl = &App::getTemplate();
    $oTpl->assign(array
    (
    	'itemid' => $oReq->get('id'),
    ));
}
else
{
	if (isset($_POST['xajax']))
	{
		App::loadAjax('Video', array(
			'videoAddFeature',
			'videoRemoveFeature',
			'videoHotAdd',
			'videoBox',
			'latestVideos'
		));
	}
	
	if ( $oReq->get('type')
		|| $oReq->get('tag')
		|| $oReq->get('listid')
		|| $oReq->get('search')
		|| $oReq->get('reported')
	)
	{
		App::loadAjax('Video', array(
			'videoAddFeature',
			'videoRemoveFeature',
			'videoHotAdd',
		));

	    $oTpl = &App::getTemplate();
    	$oTpl->assign(array
    	(
    		'browse' => true,
    	));
	}
	else
	{
		App::loadAjax('Video', array(
			'videoBox',
			'latestVideos',
		));
	}
}

?>
